home *** CD-ROM | disk | FTP | other *** search
- Path: vb.franken.de!volker
- From: volker@vb.franken.de (Volker Barthelmann)
- Subject: Re: 680X0 -> PPC translator?
- Newsgroups: comp.sys.amiga.programmer
- References: <313D3A8F.148C@sapiens.com> <volker.0fpv@vb.franken.de> <3143E4EB.7303@sapiens.com>
- X-Newsreader: TIN [AMIGA 1.3 950726BETA PL0]
- Message-ID: <volker.0fsu@vb.franken.de>
- Date: 11 Mar 96 23:02:07 MET
- Organization: home
-
-
- In article <3143E4EB.7303@sapiens.com> you wrote:
- :
- : Well, even so it still doesn't affect the translation process and that's simply becuase in
- : order to make a dynamic call (ie run-time address calc.) the base address of the function is
- : referenced somewhere in the program right?!
-
- It doesn't have to be.
-
- : so you can collect all these addresses and then see
- : where they're used as jump/call operands in an indirect call somewhere else in the program.
-
- Easy said, but really doing this is a different story. First, You'll have to
- kind of disassemble the program and therefore You have to know what is data
- and what is code, but that's what You want to decide, so...
-
- Also doing this kind of analysis is pretty much impossible on Assembler code.
-
- : remember that all such addresses are 'lea'ed somewhere in the program and probably stored in
- : some variable in memory and when needed is used to load an address register for making the jump
-
- And a variable in memory in assembler looks like xyz(a7), but only at one
- point, because at another point it is xyz+c(a7). It is probably impossible
- to detect if they point to the same address.
-
- : or simply used directly, in either case to resolve the problem of dynamic address resolution,
- : address context analysis must be performed on EACH such address in the program, while it
- : implies hugh data structures, it is very much theoratically possible. also bear in mind that
-
- It is not theoretically possible. There are some simple cases where it may
- work, that's all.
-
- : all external references are assumed to be translated code already, so we don't care about that
- : but ALL internal references can be resolved because SOMEWHERE, SOMEONE must have used them and
- : don't tell me that function addresses are being used in arithmatic calculations, that is simply
- : weird programming, don't you agree and so the exact entry point is located somewhere in the
-
- I don't agree.
- Function addresses are often used in arithmetic calculations. Examples are
- copying of code or control-structures like in special switch-statements.
-
- : program, hey no one said that the translator has to be a stupid one, hell no, it is pretty much
- : intelligent in that respect, that is one of the fields in which it excels i think, to be able
- : to resolve dynamic addresses. if the branch is to some externally allocated memory, in which
- : case you don't have an address, then this falls under the heading of self
-
- There are many many cases where You don't know the address. You could get the
- adress by an external function or it could be contained in data structure etc.etc.
-
- : modifying/relocating code and then you have to simply change the source bytes, meaning the
- : code bytes being copied to PPC code ofcourse, however a problem arises if the code size differs
- : from the translated code size, then you'll have to locate the code that does the copying and
-
- And You have to locate the place where the memory for the code is allocated
- and then adjust it according to the new size for the PPC code. And You have to
- change all the other points where this size is used e.g in a loop.
- There is absolutely no way to do this reliably.
-
-
- Volker
-
-
-